package com.other.rabbitmq_other_user;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 * User: lixiao
 * Created Date: 2020/5/11 17:08
 */
@Configuration
public class RabbitMaConfig {

    /**
     * 使用简单模型
     */

    public Queue directQueue() {
        return new Queue("testDirectQueue", true);
    }

    public DirectExchange directExchange() {
        return new DirectExchange("testDirectExchange");
    }

    Binding bindingDirect() {
        return BindingBuilder.bind(directQueue()).to(directExchange()).with("TestDirectRouting");
    }

}